<div class="tableform">
  <form id="bind-shop-form" method="post" action="index.php?app=wmsmgr&ctl=admin_wms&act=bind_shop">
      <input type="hidden" name="channel_id" value="<{$channel_id}>">
      <div class="division">
          <table cellpadding="0" cellspacing="0" border="0">
            <tbody>
              <tr>
                <th>绑定店铺：</th>
                <td>
                    <{input type='object' object='shop@ome'  name='shop_id' filter=$filter required="required"}>
                </td>
              </tr>
            </tbody>
          </table>
      </div>
    </form>
</div>
<{area inject=".mainFoot"}>
<div class="table-action">
  <table width="100%" cellspacing="0" cellpadding="0">
    <tbody>
      <tr><td>
        <{button class="btn-primary" label="确定"   type="button" id="bind-shop-btn"}>
      </td></tr>
    </tbody>
  </table>
</div>
<{/area}>
<script type="text/javascript">
(function(){
$('bind-shop-form').store('target',{
    onRequest:function(){
      $('bind-shop-btn').set('disabled','disabled');
      $('bind-shop-btn').setStyle('cursor','not-allowed');
    },
    onSuccess:function(resp){
      resp = JSON.decode(resp);

      if (resp.error) {
        return MessageBox.error(resp.error);
      }

      MessageBox.success(resp.success);

      $('bind-shop-btn').getParent('.dialog').retrieve('instance').close();
      finderGroup['<{$env.get.finder_id}>'].refresh();
    },
    onComplete:function(){
      $('bind-shop-btn').set('disabled','');
      $('bind-shop-btn').setStyle('cursor','pointer');
    }
});

$('bind-shop-btn').addEvent('click',function(){
    $('bind-shop-form').fireEvent('submit',{stop:$empty});
});

})();
</script>